<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0,  maximum-scale=1.0"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/shopcartstatic/css/public.css"/>
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/weui.min.css">
    <link rel="stylesheet" href="${ctxStatic}/shopcartstatic/css/easyLife/style.css">
</head>

<body>
<div class="tip-info" style="display:none;"><span id="loginError"></span></div>


		<header class="header">
			<div class="h-search">
				<form action="easyLifeSearch" id="searchform">
				<input type="search" class="h-search-input" name="search" placeholder="请输入商品名称">
				<i class="ic-search"></i>
				</form>
			</div>
			<div class="h-type j_type"><span class="j_type_txt"></span><b class="icon-arrow-b"></b></div>
		</header>

		<div class="goods-area">
			<c:forEach items="${productlist}" var="p">

        <div class="weui-cells goods-list">
            <div class="weui-cell goods-item1" data-id="1" data-cover="1" data-title="商品1" data-price="1" data-yb="1">
                <a href="easyLifedetails?productid=${p.id}">
                    <div class="weui-cell__hd"><img src="${p.imgList[0]}" alt=""
                                                    style="width:80px;height:80px;margin-right:15px;display:block">
                    </div>
                </a>
                <div class="weui-cell__bd">
                        <%--						href="easyLifedetails?productid=${p.id}"--%>
                    <a>
                        <p class="g-info-title">${p.name}</p>
                        <p class="g-info-subtitle">品牌：${p.brand}</p>
                        <p class="money">￥${p.price}</p>
                        <p class="g-info-rebeat">店铺：${p.sellshop}</p>
                    </a>
                </div>

                <div class="g-info-number">
                    <div class="w-number">
							<span class="tuan_div3_sp2">
                                    <c:if test="${p.bool==0}">
                                        <img alt="" src="${ctxStatic}/shopcartstatic/images/collectionselect.png"
                                             onclick="changeimg2('${p.id}',this)">
                                    </c:if>
                                    <c:if test="${p.bool==1}">
                                        <img alt="" src="${ctxStatic}/shopcartstatic/images/collectionselected.png"
                                             onclick="changeimg2('${p.id}',this)">
                                    </c:if>
							</span>
                    </div>
                </div>
            </div>
        </div>

				</c:forEach>
				<div class="weui-cell goods-item2" data-id="2" data-cover="2" data-title="商品2" data-price="2" data-yb="2">

				</div>
			</div>
			<%--<p class="more">加载中...</p>--%>
		</div>
		<div class="mask-layer"></div>
		<!-- 分类菜单 -->
		<div class="type-area">
			<ul class="type-list">
				<c:forEach items="${categorylist}" var="c">
					<li class="type-item j-type-item ta-right" data-typeId="${tvo.typeId}"><a href="../client/easyLife?index=1&categoryid=${c.id}">${c.name}</a></li>
    </c:forEach>
</div>
</div>
<div class="mask-layer"></div>
<!-- 分类菜单 -->
<div class="type-area">
    <ul class="type-list">
        <c:forEach items="${categorylist}" var="c">
            <li class="type-item j-type-item ta-right" data-typeId="${tvo.typeId}"><a
                    href="../client/easyLife?index=1&categoryid=${c.id}">${c.name}</a></li>

        </c:forEach>
    </ul>
</div>
<!--底部导航栏 -->
<div class="nav" id="tabbar"></div>

<script src="${ctxStatic}/shopcartstatic/js/jquery-1.6.2.min.js "></script>
<script type="text/javascript " src="${ctxStatic}/shopcartstatic/js/public.js "></script>
<script type="text/javascript " src="${ctxStatic}/shopcartstatic/js/easyLife/easyLife.js"></script>
<script>

    var $message = '${message}';
    if ($message != null && $message != '') {
        $(".tip-info").show();
        setTimeout(function () {
            $(".tip-info").hide();
        }, 3000);
    }

    function changeimg2(id, cc) {

        if (cc.src.indexOf('ed') >= 0) {
            //取消收藏
            $("#loginError").html("取消收藏成功");
            $(".tip-info").show();
            setTimeout(function () {
                $(".tip-info").hide();
            }, 2000);
            cc.src = "${ctxStatic}/shopcartstatic/images/collectionselect.png"
            window.location.href = "/shop/client/collectionsdel2?id=" + id;
        } else {
            //收藏成功
            $("#loginError").html("收藏成功")
            $(".tip-info").show();
            setTimeout(function () {
                $(".tip-info").hide();
            }, 2000);
            cc.src = "${ctxStatic}/shopcartstatic/images/collectionselected.png";
            window.location.href = "/shop/client/collectionsadd?id=" + id;
        }
    }
</script>
</body>

</html>